//
//  APIObject.h
//  YDdDemo
//
//  Created by 瞿伦平 on 2017/10/20.
//  Copyright © 2017年 瞿伦平. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "QUCustomDefine.h"
#import "QUObject.h"
#import "UIViewController+Additions.h"

#pragma mark - NSString
@interface NSString (APIObject_Additions)
+(NSString*)strWithMoney:(float)value; //!< 去掉浮点数后面多余的0
+(NSString*)strRMBWithMoney:(float)value; //!< 得到金钱字符串

@end



@interface APIObject : NSObject
@property (nonatomic,strong) id                 data;         //正文
@property (nonatomic,strong) NSString *         msg;   //错误消息
@property (nonatomic,assign) int                code;         //非0表示 错误,调试使用
+(APIObject *)infoWithError:(NSError *)error;
+(APIObject *)infoWithErrorMessage:(NSString *)errMsg;
+(APIObject *)infoWithReLoginErrorMessage:(NSString *)errMsg;
@end






///订单评论对象
@interface OrderCommentObject : NSObject                                        //!<
@property(nonatomic,assign) int                 star;                        //!<　评分
@property(nonatomic,assign) NSTimeInterval      commenttime;                   //!< 评价时间
@property(nonatomic,strong) NSString*           comment;                  //!<  评语
@property(nonatomic,strong) NSString*           phone;                  //!<  评论人手机
@property(nonatomic,strong) NSString*           nickname;                  //!<  评论人昵称
@property(nonatomic,strong) NSString*           avatar;                  //!<  评论人头像
@end




///商品信息
@interface FoodGoods : NSObject
@property(nonatomic,strong) NSString*   iD;      //!< 商品id
@property(nonatomic,strong) NSString*   c_id;      //!< id
@property(nonatomic,strong) NSString*   classid;      //!< id
@property(nonatomic,strong) NSString*   introduction;      //!< 描述
@property(nonatomic,strong) NSString*   name;       //!< 名称
@property(nonatomic,strong) NSString*   img;       //!<  图片地址
@property(nonatomic,assign) float       price;       //!< 售价

@property(nonatomic,assign) int       num;       //!< 数量
@end


//菜品分类
@interface FoodCate : NSObject
@property(nonatomic,strong) NSString*           gcate_id;      //!< 菜类id
@property(nonatomic,strong) NSString*           clasname;      //!< 菜类名（如素菜）
@property(nonatomic,strong) NSMutableArray*     details;       //!< 菜品列 --FoodGoods
@end




///店铺基本信息
@interface Shop : NSObject
@property(nonatomic,assign) int         countcomment;      //!< 评论数
@property(nonatomic,assign) int         order;      //!< 订单数
@property(nonatomic,assign) int         star;      //!< 星数
@property(nonatomic,strong) NSString*   name;      //!< 名字
@property(nonatomic,strong) NSArray*    figurepic;      //!< 图片
@property(nonatomic,strong) NSString*   iD;      //!< 店铺id
@property(nonatomic,strong) NSString*   km;      //!< 距离
@property(nonatomic,assign) double      latitude;      //!< 精度
@property(nonatomic,assign) double      longitude;      //!< 图片
@property(nonatomic,strong) NSString*   profile;      //!< 描述
@property(nonatomic,strong) NSString*   suite;      //!< 地址
@end




@interface FoodShop : NSObject
@property(nonatomic,strong) Shop*               shop_info;      //!< 菜类名（如素菜）
@property(nonatomic,strong) NSMutableArray*     goods;       //!< 菜品列 --FoodCate
@property(nonatomic,strong) FoodGoods*          goods_box;       //!< 打包盒
@end



///配送信息
@interface Shippingfee : NSObject
@property(nonatomic,assign) int         iD;      //!< id
@property(nonatomic,assign) float       cost;      //!< 起始配送费 元
@property(nonatomic,assign) float       km;      //!< 每超过1公里  km
@property(nonatomic,assign) float       mixkm;      //!< 最大配送距离  km
@property(nonatomic,assign) float       minxcost;      //!< 每超过1公里加2元  元
@property(nonatomic,assign) float       startkm;      //!< 起始配送距离  KM
@end



